//
//  JYTFeaturesCell.m
//  JYT_IOS
//
//  Created by nxa-tankeke on 16/12/20.
//  Copyright © 2016年 nxa-yuanguoxiang. All rights reserved.
//

#import "JYTFeaturesCell.h"
#import "Feature.h"
#import <UIImageView+WebCache.h>

@interface JYTFeaturesCell()

@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UILabel *signLabel;

@end


@implementation JYTFeaturesCell

-(void)setFeature:(Feature *)feature
{
    _feature = feature;
    
    //[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:feature.header] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
  
    NSString *header = feature.header;
    if ([header hasPrefix:@"http"]) {
        [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:header]];
    } else {
        [self.headerImageView setImage:[UIImage imageNamed:header]];
    }
    
    [self.nameLabel setText:feature.name];
    
    [self.signLabel setText:feature.sign];
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.headerImageView.layer.cornerRadius = self.headerImageView.bounds.size.width / 2;
    self.headerImageView.clipsToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
